home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side1.d64
/
scroll source
< prev
next >
Wrap
Text File
|
2022-08-28
|
4KB
|
379 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
load =$ffd5
getin =$ffe4
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
unlisten =$ffae
clall =$ffe7
;scroll sysaddr,x,to x,y, to y, direction
;dir 0=up 1= down 2=left 3=right 4=up/left 5=up/right 6=down/left 7=down/right
;clear line sysaddr+3,screen code,color
.org $cc00
.obj "scroll cc00"
jmp over
jmp clear'row
over jsr get'number
sta startingx
cmp #40
bcs quit
jsr get'number
sta endingx
cmp #40
bcs quit
jsr get'number
sta startingy
cmp #25
bcs quit
jsr get'number
sta endingy
cmp #25
bcs quit
jsr get'number
and #7
sta direction
jmp linx
quit rts
linx ldy #24
- lda 217,y
ora #128
sta 217,y
dey
bpl -
get'routine lda direction
asl
tax
lda sub'table+1,x
pha
lda sub'table,x
pha
rts
scroll'up ldy startingx
ldx startingy
stx line
clc
jsr plot
jsr old'rom'patch
scroll'up'math clc
lda 209
adc <40
sta 251
lda 210
adc >40
sta 252
clc
lda 243
adc <40
sta 253
lda 244
adc >40
sta 254
ldy startingx
- lda (251),y
sta (209),y
lda (253),y
sta (243),y
iny
cpy endingx
beq -
bcc -
inc line
lda line
cmp endingy
bcs through'scrolling'up
clc
lda 209
adc <40
sta 209
lda 210
adc >40
sta 210
clc
lda 243
adc <40
sta 243
lda 244
adc >40
sta 244
jmp scroll'up'math
through'scrolling'up ldx endingy
ldy startingx
clc
jmp plot
jsr old'rom'patch
scroll'down ldy startingx
ldx endingy
stx line
clc
jsr plot
jsr old'rom'patch
scroll'down'math sec
lda 209
sbc <40
sta 251
lda 210
sbc >40
sta 252
sec
lda 243
sbc <40
sta 253
lda 244
sbc >40
sta 254
ldy startingx
- lda (251),y
sta (209),y
lda (253),y
sta (243),y
iny
cpy endingx
beq -
bcc -
dec line
lda line
cmp startingy
beq through'scrolling'down
sec
lda 209
sbc <40
sta 209
lda 210
sbc >40
sta 210
sec
lda 243
sbc <40
sta 243
lda 244
sbc >40
sta 244
jmp scroll'down'math
through'scrolling'down ldx startingy
ldy startingx
clc
jsr plot
jmp old'rom'patch
scroll'left ldy startingx
ldx startingy
stx line
clc
jsr plot
jsr old'rom'patch
scroll'left'math clc
lda 209
adc <1
sta 251
lda 210
adc >1
sta 252
clc
lda 243
adc <1
sta 253
lda 244
adc >1
sta 254
ldy startingx
- lda (251),y
sta (209),y
lda (253),y
sta (243),y
iny
cpy endingx
beq -
bcc -
inc line
lda line
cmp endingy
bcs through'scrolling'left
clc
lda 209
adc <40
sta 209
lda 210
adc >40
sta 210
clc
lda 243
adc <40
sta 243
lda 244
adc >40
sta 244
jmp scroll'left'math
through'scrolling'left ldx startingy
ldy endingx
clc
jsr plot
jmp old'rom'patch
scroll'right ldy startingx
ldx startingy
stx line
clc
jsr plot
jsr old'rom'patch
scroll'right'math clc
lda 209
adc <1
sta 251
lda 210
adc >1
sta 252
clc
lda 243
adc <1
sta 253
lda 244
adc >1
sta 254
ldy endingx
dey
- lda (209),y
sta (251),y
lda (243),y
sta (253),y
dey
bmi +
cpy startingx
beq -
bcs -
+ inc line
lda line
cmp endingy
bcs through'scrolling'right
clc
lda 209
adc <40
sta 209
lda 210
adc >40
sta 210
clc
lda 243
adc <40
sta 243
lda 244
adc >40
sta 244
jmp scroll'right'math
through'scrolling'right ldx startingy
ldy endingx
clc
jsr plot
jmp old'rom'patch
scroll'up'left jsr scroll'up
jmp scroll'left
scroll'up'right jsr scroll'up
jmp scroll'right
scroll'down'left jsr scroll'down
jmp scroll'left
scroll'down'right jsr scroll'down
jmp scroll'right
clear'row jsr get'number
sta char
jsr get'number
sta color
ldy startingx
- lda char
sta (209),y
lda color
sta (243),y
iny
cpy endingx
beq -
bcc -
rts
old'rom'patch lda 210
sec
sbc 648
clc
adc #$d8
sta 244
lda 209
sta 243
rts
;**** get number from BASIC ****
get'number jsr $aefd
jsr $ad8a
jsr $b7f7
lda $14 ; got low byte
rts
startingx .byt 0
endingx .byt 0
startingy .byt 0
endingy .byt 0
direction .byt 0
char .byt 0
color .byt 0
line .byt 0
sub'table .word scroll'up-1,scroll'down-1,scroll'left-1,scroll'right-1
.word scroll'up'left-1,scroll'up'right-1,scroll'down'left-1,scroll'down'right-1